//
//  FriendsCell.m
//  好友列表
//
//  Created by 伍银荣 on 2021/6/8.
//  Copyright © 2021 com.example. All rights reserved.
//

#import "FriendsCell.h"
#import "Friends.h"

@implementation FriendsCell

+(instancetype)friendsCellWithTableView:(UITableView *)tableView {
    static NSString *ID = @"group_cell";
    FriendsCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[FriendsCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}

-(void)setFriends:(Friends *)friends {
    _friends = friends;
    //设置数据
    self.imageView.image = [UIImage imageNamed:friends.icon];
    self.textLabel.text = friends.name;
    self.detailTextLabel.text = friends.intro;
    self.textLabel.textColor = friends.isVip ? [UIColor redColor] : [UIColor blackColor];
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
